<?php
 header('content-type:text/html;charset=utf-8'); 
	$lot=$_GET["lot"];
	$dbName = "sqlsrv:Server=172.31.3.9,1433;Database=UFDATA_001_2017";   //emc3030
	$dbUser = "sa";    //
	$dbPassword = "TDled2017";    //
	$db = new PDO($dbName, $dbUser, $dbPassword);   
	
   
	$sql = "select InvCode from mom_orderdetail where moid=(select moid from mom_order where MoCode='".$lot."') ";  //
	//print_r($sql);
	$res = $db->query($sql);
	//print_r($res);
	$MoDId="";
	$InvCode="";
	//$row = null;
	 while ($row = $res->fetch()){
		
		$InvCode=$row['InvCode'];
	}	
	
	$res = null;

	$db = null;
    $co= $InvCode;               	
	 print_r($co);
